#ifndef FRIENDTABLE_H
#define FRIENDTABLE_H

#include "../data/userprofile.h"

#include <QObject>
#include <QMap>

namespace Sqlite {

class FriendProfileTable : public QObject
{
    Q_OBJECT
public:
    explicit FriendProfileTable(QObject *parent = 0);

    static void createTable();
    static void addFriendProfile(const UserProfile* fProfile);
    static QList<UserProfile*> getAllFriendProfile();
    static void clearTable();
    static void updateMessageStatus(const qint64 friendId,
                                    const int senderMsg,
                                    const QString msgStatus,
                                    const qint64 time,
                                    const int typeMsg);
    static QList<UserProfile*> friendListSortByName();


    static void createTableFTS();
    static void addFriendProfileFTS(const UserProfile* fProfile);
    static QList<UserProfile*> searchFriendsFTS(QString input);
    static void clearTableFTS();

    static QList<UserProfile*> refreshListFriends();

};

}
#endif // FRIENDTABLE_H
